use crate::bootstrap::AppState;
use crate::controller::admin::category;
use axum::{
    routing::{delete, get, post, put},
    Router,
};
use utoipa::OpenApi;

// #[derive(OpenApi)]
// #[openapi(paths(category::modify_by_id))]
// pub(super) struct CategoryApi;

pub fn category_router(state: AppState) -> Router<AppState> {
    let router = Router::new()
        .route("/", post(category::create_category))
        .route("/", put(category::modify_by_id))
        .route("/", delete(category::delete_by_id))
        .route("/list", get(category::query_by_type))
        .route("/page", get(category::page_query))
        .route("/status/:status", post(category::enable_disable))
        .with_state(state);

    router
}
